package com.zhijian.medical.dao.local;

import com.zhijian.medical.entity.po.CnasNewLocation;
import com.zhijian.medical.entity.vo.request.CnasNewLocationSearchVo;
import com.zhijian.medical.entity.vo.response.CnasNewLocationVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface CnasNewLocationMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CnasNewLocation record);

    int insertSelective(CnasNewLocation record);

    CnasNewLocation selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CnasNewLocation record);

    int updateByPrimaryKey(CnasNewLocation record);

    /**
     * 查询总数
     *
     * @param cnasNewLocationSearchVo
     * @return
     */
    int count(CnasNewLocationSearchVo cnasNewLocationSearchVo);

    /**
     * 查询列表
     *
     * @param cnasNewLocationSearchVo
     * @return
     */
    List<CnasNewLocationVo> selectList(CnasNewLocationSearchVo cnasNewLocationSearchVo);

    /**
     * 查询单个
     *
     * @param cnasNewLocationSearchVo
     * @return
     */
    CnasNewLocationVo selectOne(CnasNewLocationSearchVo cnasNewLocationSearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    CnasNewLocationVo selectVoById(Long id);


    Long findLocationIdByNameAndParent(@Param("name") String name, @Param("parentType") Integer parentType);
    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    void insertLocation(@Param("name") String name, @Param("parentId") Long parentId, @Param("type") Integer type, @Param("parentType") Integer parentType);

    Integer findTypeByTitle(@Param("title") String title);
    /**
     * 动态删除
     *
     * @param cnasNewLocationSearchVo
     * @return
     */
    void deleteByCondition(CnasNewLocationSearchVo cnasNewLocationSearchVo);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<CnasNewLocation> entities);

    /**
     * 根据ParentId查询列表
     *
     * @param parentId
     * @return
     */
    List<CnasNewLocationVo> selectListByParentId(Long parentId);
}